package com.kawaiior.asoulworld.blocks.blockAsoul;

import com.kawaiior.asoulworld.blocks.BlockBase;
import com.kawaiior.asoulworld.item.ModItems;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Mod;

import java.util.Random;

public class BlockAsoulMineral extends BlockBase {

    public BlockAsoulMineral(String name, Material material, int harvestLevel) {
        super(name, material);
//        this.setHarvestLevel();
        setHardness(10F);
        setResistance(1200f);
        setHarvestLevel("pickaxe", harvestLevel);
        setSoundType(SoundType.STONE);
    }

    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        return ModItems.AS_SOUL_STONE;
    }

    @Override
    public int quantityDropped(Random random)
    {
        int min = 1;
        int max = 7;
        return random.nextInt(random.nextInt(max)+1)+min;
    }

    @Override
    public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
    {
        Random rand = world instanceof World ? ((World)world).rand : new Random();
        return MathHelper.getInt(rand, 6, 10);
    }

}
